package com.moons.uvcdemo;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;

import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.AssetManager;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
//import android.support.v4.app.ActivityCompat;
//import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.util.Size;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;

import com.moons.uvcdemo.R;
import com.xqd.sdk.libaicamera.AICamera;
import com.xqd.sdk.libaicamera.AICameraManager;
import com.xqd.sdk.libaicamera.face.FaceObject;
import com.xqd.sdk.libaicamera.utils.Utils;


import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

public class ScreenTestActivity extends AppCompatActivity {

    private static final String TAG = "ScreenTestActivity";
    TextView screen_lay;
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_screen);
        screen_lay = findViewById(R.id.screen_lay);
        greenHandle.postDelayed(mRunnable, 1000);
        blueHandle.postDelayed(mblueRunnable, 2000);
    }

    private Handler greenHandle = new Handler();
    //
    private Runnable mRunnable = new Runnable() {
        @Override
        public void run() {//
             runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    screen_lay.setBackgroundColor(Color.GREEN);
                }
            });
//            greenHandle.postDelayed(mRunnable, 1000);
        }
    };

    private Handler blueHandle = new Handler();
    //
    private Runnable mblueRunnable = new Runnable() {
        @Override
        public void run() {//
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    screen_lay.setBackgroundColor(Color.BLUE);
                }
            });
//            blueHandle.postDelayed(mblueRunnable, 2000);
        }
    };

    @Override
    protected void onPause() {
        Log.d(TAG, "==============onPause=========");
        super.onPause();
    }

    @Override
    protected void onResume() {
        Log.d(TAG, "onResume");
        super.onResume();
    }



}
